/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  					   scaled_adventure_map_drawer.h

	$Header: /game/scaled_adventure_map_drawer.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCALED_ADVENTURE_MAP_DRAWER_H_INCLUDED )
#define SCALED_ADVENTURE_MAP_DRAWER_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_bitmap_typedef.h"
#include "owned_ptr.h"

class t_abstract_adventure_map;
struct t_screen_point;
struct t_screen_rect;

// --------------------------------------------------------------------------
// t_scaled_adventure_map_drawer - function object class to draw an adventure
// map scaled
// --------------------------------------------------------------------------

class t_scaled_adventure_map_drawer
{
public:
	// Types
	enum t_scale
	{
		k_scale_full,
		k_scale_half,
		k_scale_quarter,
		k_scale_eighth,
		k_scale_sixteenth,

		k_scale_count,
	};

	// Constructor/Destructor
	explicit t_scaled_adventure_map_drawer(
		t_abstract_adventure_map const &	map,
		int									view_level = 0,
		int									team_view = -1 );
	~t_scaled_adventure_map_drawer();

	// Member functions
	int		get_team_view() const;
	int		get_view_level() const;
	void	set_team_view( int team_view );
	void	set_view_level( int new_view_level );

	// Operator
	void	operator()(
				t_scale					scale,
				t_screen_rect const &	source_rect,
				t_abstract_bitmap16 &	dest,
				t_screen_point const &	dest_pos ) const;

private:
	// Types
	class t_impl;

	// Data members
	t_owned_ptr< t_impl >	m_impl_ptr;
};

// --------------------------------------------------------------------------
// Non-member functions
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
int get_factor( t_scaled_adventure_map_drawer::t_scale scale_id );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
int get_shift( t_scaled_adventure_map_drawer::t_scale scale_id );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
t_screen_point scale(
	t_screen_point const &					point,
	t_scaled_adventure_map_drawer::t_scale	scale_id );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
t_screen_rect scale(
	t_screen_rect const &					rect,
	t_scaled_adventure_map_drawer::t_scale	scale_id );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
t_screen_point unscale(
	t_screen_point const &					point,
	t_scaled_adventure_map_drawer::t_scale	scale_id );

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
t_screen_rect unscale(
	t_screen_rect const &					rect,
	t_scaled_adventure_map_drawer::t_scale	scale_id );

#endif // !defined( SCALED_ADVENTURE_MAP_DRAWER_H_INCLUDED )
